﻿using System;
using System.Collections.Generic;
using System.Text;
using ZLDC.Common.Estate;
using ZLDC.Topo.Model.Estate;

namespace ZLDC.Topo.BLL.Estate
{
                public class UserOptionBLL
    {
                                        public static string p_user_option_detail(int tableName, int userid)
        {            
            string fieldnames = "";
            string fieldvalues = "";
            
            using (_Database db = new _Database("estate"))
            {
                UserOptionInfo info = ZLDC.DAL.Estate.UserOptionDAL.p_user_option_detail(tableName, userid, db);

                if (info != null)
                {
                    fieldnames = info.FieldName;
                    fieldvalues = info.Fields;
                }
            }

            return "field:{fieldnames:'" + fieldnames + "',fieldvalues:'" + fieldvalues + "'}";
        }

                                                                                                                        public static string p_user_option_save(int userId, int tableName, string fieldName, string fields, string modifyUser, int dltFlg, string mark1, string mark2, string mark3)
        {
            string outmsg = "";
            int newid = 0;

            using (_Database db = new _Database("estate"))
            {
                ZLDC.DAL.Estate.UserOptionDAL.p_user_option_save(userId, tableName, fieldName, fields, modifyUser, dltFlg, mark1, mark2, mark3, out outmsg, out newid, db);
            }

            return outmsg;
        }

    }
}
